import {observable, action} from "mobx";
import request from "../utils/request";
import * as api from "../api/api";
import {LoadHoc, loading} from '../hoc/loadHoc';

/**
 * 生活服务中心
 */
export default class LifeServiceStore extends LoadHoc {
  /**
   * 获取服务应用
   */
  @observable allLifeService: api.YNJWTHomeVOIndexVO = {};
  @loading @action
  async getAllLifeService(params: {
    callBack: (res: api.YNJWTLifeServiceCenterVOLifeServiceAppVO) => void
  }) {
    const { callBack } = params
    let allLifeService = await request(api.ApplifeServiceCenterApiFetchParamCreactor.applifeServiceCenterGetAllLifeServiceCenterInfoAsync({}))
    this.allLifeService = allLifeService;
    callBack && callBack(allLifeService)
  }
}
